﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SharedGenomics.Workbench.Core;
using SharedGenomics.Core;

namespace SharedGenomics.Workbench.PresentationModel
{
    public class DataFilterPTO : PresentationTransferObject
    {
        public int? SelectedFileSetId
        {
            get { return this.GetPropertyValue<int?>("SelectedFileSetId"); }
            set { this.SetPropertyValue("SelectedFileSetId", value); }
        }

        public IEnumerable<ValueDisplayItem<int>> AvailableFileSets
        {
            get { return this.GetPropertyValue<IEnumerable<ValueDisplayItem<int>>>("AvailableFileSets"); }
            set { this.SetPropertyValue("AvailableFileSets", value); }
        }

        public string DataSetName
        {
            get { return this.GetPropertyValue<string>("DataSetName"); }
            set { this.SetPropertyValue("DataSetName", value); }
        }

        protected override void Validate(IValidationErrorCollection validationErrors)
        {
            if (this.DataSetName.IsEmptyOrWhitespace())
            {
                validationErrors.Add("Data set name required", this, "DataSetName");
            }

            //if (!this.SelectedFileSetId.HasValue)
            //{
            //    validationErrors.Add("No file set selected", this, "SelectedFileSetId");
            //}
        }
    }
}
